package config

import (
	cliflag "gitee.com/vrv_media/go-micro-framework/pkg/common/cli/flag"
	"gitee.com/vrv_media/go-micro-framework/pkg/logger"
)

type Config struct {
	Log *logger.Options `json:"log" mapstructure:"log"` // log日志包 相关配置
}

func NewConfig() *Config {
	return &Config{
		Log: logger.NewOptions(logger.WithColor(true)),
	}
}
func (c *Config) Flags() (fss cliflag.NamedFlagSets) {
	c.Log.AddFlags(fss.FlagSet("log"))
	return
}

func (c *Config) Validate() []error {
	var errors []error
	errors = append(errors, c.Log.Validate())
	return errors
}
